/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'agency.aliyuncs.com',
    ap-northeast-2-pop = 'agency.aliyuncs.com',
    ap-south-1 = 'agency.aliyuncs.com',
    ap-southeast-2 = 'agency.aliyuncs.com',
    ap-southeast-3 = 'agency.aliyuncs.com',
    ap-southeast-5 = 'agency.aliyuncs.com',
    cn-beijing = 'agency.aliyuncs.com',
    cn-beijing-finance-1 = 'agency.aliyuncs.com',
    cn-beijing-finance-pop = 'agency.aliyuncs.com',
    cn-beijing-gov-1 = 'agency.aliyuncs.com',
    cn-beijing-nu16-b01 = 'agency.aliyuncs.com',
    cn-chengdu = 'agency.aliyuncs.com',
    cn-edge-1 = 'agency.aliyuncs.com',
    cn-fujian = 'agency.aliyuncs.com',
    cn-haidian-cm12-c01 = 'agency.aliyuncs.com',
    cn-hangzhou = 'agency.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'agency.aliyuncs.com',
    cn-hangzhou-finance = 'agency.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'agency.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'agency.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'agency.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'agency.aliyuncs.com',
    cn-hangzhou-test-306 = 'agency.aliyuncs.com',
    cn-hongkong = 'agency.aliyuncs.com',
    cn-hongkong-finance-pop = 'agency.aliyuncs.com',
    cn-huhehaote = 'agency.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'agency.aliyuncs.com',
    cn-north-2-gov-1 = 'agency.aliyuncs.com',
    cn-qingdao = 'agency.aliyuncs.com',
    cn-qingdao-nebula = 'agency.aliyuncs.com',
    cn-shanghai = 'agency.aliyuncs.com',
    cn-shanghai-et15-b01 = 'agency.aliyuncs.com',
    cn-shanghai-et2-b01 = 'agency.aliyuncs.com',
    cn-shanghai-finance-1 = 'agency.aliyuncs.com',
    cn-shanghai-inner = 'agency.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'agency.aliyuncs.com',
    cn-shenzhen = 'agency.aliyuncs.com',
    cn-shenzhen-finance-1 = 'agency.aliyuncs.com',
    cn-shenzhen-inner = 'agency.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'agency.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'agency.aliyuncs.com',
    cn-wuhan = 'agency.aliyuncs.com',
    cn-wulanchabu = 'agency.aliyuncs.com',
    cn-yushanfang = 'agency.aliyuncs.com',
    cn-zhangbei = 'agency.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'agency.aliyuncs.com',
    cn-zhangjiakou = 'agency.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'agency.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'agency.aliyuncs.com',
    eu-central-1 = 'agency.aliyuncs.com',
    eu-west-1 = 'agency.aliyuncs.com',
    eu-west-1-oxs = 'agency.aliyuncs.com',
    me-east-1 = 'agency.aliyuncs.com',
    rus-west-1-pop = 'agency.aliyuncs.com',
    us-east-1 = 'agency.aliyuncs.com',
    us-west-1 = 'agency.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('agency', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ClearOutstandingBalanceRequest {
  aliyunPk?: long(name='AliyunPk'),
  debtQuota?: string(name='DebtQuota'),
  endUserPk?: long(name='EndUserPk'),
}

model ClearOutstandingBalanceResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ClearOutstandingBalanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ClearOutstandingBalanceResponseBody(name='body'),
}

async function clearOutstandingBalanceWithOptions(request: ClearOutstandingBalanceRequest, runtime: Util.RuntimeOptions): ClearOutstandingBalanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.debtQuota)) {
    query['DebtQuota'] = request.debtQuota;
  }
  if (!Util.isUnset(request.endUserPk)) {
    query['EndUserPk'] = request.endUserPk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ClearOutstandingBalance',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function clearOutstandingBalance(request: ClearOutstandingBalanceRequest): ClearOutstandingBalanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return clearOutstandingBalanceWithOptions(request, runtime);
}

model CreateNormalAccountRequest {
  createNormalAccountInfoList?: [ 
    {
      aliyunPk?: long(name='AliyunPk'),
      cid?: long(name='Cid'),
      customCredit?: string(name='CustomCredit'),
      customNick?: string(name='CustomNick'),
      customerAccount?: string(name='CustomerAccount'),
      customerRebateType?: string(name='CustomerRebateType'),
      fxDescription?: string(name='FxDescription'),
      fxShutdownstatus?: string(name='FxShutdownstatus'),
      isEnterprise?: int32(name='isEnterprise'),
    }
  ](name='CreateNormalAccountInfoList'),
}

model CreateNormalAccountResponseBody = {
  code?: string(name='Code'),
  data?: {
    result?: [ 
    {
      code?: string(name='Code'),
      eachData?: {
        days?: int32(name='Days'),
        id?: long(name='Id'),
        regUrl?: string(name='RegUrl'),
      }(name='EachData'),
      message?: string(name='Message'),
      success?: boolean(name='Success'),
    }
  ](name='Result')
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model CreateNormalAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateNormalAccountResponseBody(name='body'),
}

async function createNormalAccountWithOptions(request: CreateNormalAccountRequest, runtime: Util.RuntimeOptions): CreateNormalAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.createNormalAccountInfoList)) {
    query['CreateNormalAccountInfoList'] = request.createNormalAccountInfoList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateNormalAccount',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createNormalAccount(request: CreateNormalAccountRequest): CreateNormalAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createNormalAccountWithOptions(request, runtime);
}

model DeductOutstandingBalanceRequest {
  deductAmount?: string(name='DeductAmount'),
  uid?: long(name='Uid'),
}

model DeductOutstandingBalanceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model DeductOutstandingBalanceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeductOutstandingBalanceResponseBody(name='body'),
}

async function deductOutstandingBalanceWithOptions(request: DeductOutstandingBalanceRequest, runtime: Util.RuntimeOptions): DeductOutstandingBalanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deductAmount)) {
    query['DeductAmount'] = request.deductAmount;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeductOutstandingBalance',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deductOutstandingBalance(request: DeductOutstandingBalanceRequest): DeductOutstandingBalanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deductOutstandingBalanceWithOptions(request, runtime);
}

model GetAccountInfoRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  uid?: long(name='Uid'),
  userType?: string(name='UserType'),
}

model GetAccountInfoResponseBody = {
  accountInfoList?: {
    accountInfo?: [ 
    {
      accountNickname?: string(name='AccountNickname'),
      aliyunId?: string(name='AliyunId'),
      associationSuccessTime?: string(name='AssociationSuccessTime'),
      cid?: long(name='Cid'),
      email?: string(name='Email'),
      mobile?: string(name='Mobile'),
      remark?: string(name='Remark'),
      subAccountType?: int32(name='SubAccountType'),
      uid?: long(name='Uid'),
    }
  ](name='AccountInfo')
  }(name='AccountInfoList'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetAccountInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAccountInfoResponseBody(name='body'),
}

async function getAccountInfoWithOptions(request: GetAccountInfoRequest, runtime: Util.RuntimeOptions): GetAccountInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.userType)) {
    query['UserType'] = request.userType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAccountInfo',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAccountInfo(request: GetAccountInfoRequest): GetAccountInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAccountInfoWithOptions(request, runtime);
}

model GetAssociationStatusRequest {
  aliyunPk?: long(name='AliyunPk'),
  getAssociationStatusList?: [ 
    {
      inviteId?: long(name='InviteId'),
    }
  ](name='GetAssociationStatusList'),
}

model GetAssociationStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    result?: [ 
    {
      code?: string(name='Code'),
      inviteStatusList?: {
        gmtCreate?: string(name='GmtCreate'),
        parentId?: string(name='ParentId'),
        status?: int32(name='Status'),
        subAccountType?: string(name='SubAccountType'),
        validTime?: string(name='ValidTime'),
      }(name='InviteStatusList'),
      message?: string(name='Message'),
      success?: boolean(name='Success'),
    }
  ](name='Result')
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetAssociationStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAssociationStatusResponseBody(name='body'),
}

async function getAssociationStatusWithOptions(request: GetAssociationStatusRequest, runtime: Util.RuntimeOptions): GetAssociationStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.getAssociationStatusList)) {
    query['GetAssociationStatusList'] = request.getAssociationStatusList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAssociationStatus',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAssociationStatus(request: GetAssociationStatusRequest): GetAssociationStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAssociationStatusWithOptions(request, runtime);
}

model GetBillDetailRequest {
  aliyunPk?: long(name='AliyunPk'),
  billId?: long(name='BillId'),
  hid?: long(name='Hid'),
}

model GetBillDetailResponseBody = {
  code?: string(name='Code'),
  data?: {
    billEndTime?: string(name='BillEndTime'),
    billId?: string(name='BillId'),
    billStartTime?: string(name='BillStartTime'),
    offering?: string(name='Offering'),
    payStatus?: string(name='PayStatus'),
    period?: string(name='Period'),
    productCode?: string(name='ProductCode'),
    regionInfoList?: {
      regionInfo?: [ 
      {
        discountFee?: string(name='DiscountFee'),
        regionCode?: string(name='RegionCode'),
        requirePayAmount?: string(name='RequirePayAmount'),
        totalFee?: string(name='TotalFee'),
        youhuiquanPayAmount?: string(name='YouhuiquanPayAmount'),
      }
    ](name='regionInfo')
    }(name='RegionInfoList'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetBillDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetBillDetailResponseBody(name='body'),
}

async function getBillDetailWithOptions(request: GetBillDetailRequest, runtime: Util.RuntimeOptions): GetBillDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.billId)) {
    query['BillId'] = request.billId;
  }
  if (!Util.isUnset(request.hid)) {
    query['Hid'] = request.hid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBillDetail',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBillDetail(request: GetBillDetailRequest): GetBillDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBillDetailWithOptions(request, runtime);
}

model GetBillListRequest {
  aliyunPk?: long(name='AliyunPk'),
  currentPage?: int32(name='CurrentPage'),
  endDate?: string(name='EndDate'),
  instId?: string(name='InstId'),
  isStronger?: int32(name='IsStronger'),
  pageSize?: int32(name='PageSize'),
  payStatus?: long(name='PayStatus'),
  ramUid?: long(name='RamUid'),
  startDate?: string(name='StartDate'),
}

model GetBillListResponseBody = {
  code?: string(name='Code'),
  data?: {
    popBillJson?: [ 
    {
      billId?: long(name='BillId'),
      cloudAccount?: string(name='CloudAccount'),
      fee?: string(name='Fee'),
      gmtPay?: string(name='GmtPay'),
      payStatus?: long(name='PayStatus'),
      postpayBillDetail?: string(name='PostpayBillDetail'),
      productName?: string(name='ProductName'),
      ramUid?: long(name='RamUid'),
    }
  ](name='PopBillJson')
  }(name='Data'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetBillListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetBillListResponseBody(name='body'),
}

async function getBillListWithOptions(request: GetBillListRequest, runtime: Util.RuntimeOptions): GetBillListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.instId)) {
    query['InstId'] = request.instId;
  }
  if (!Util.isUnset(request.isStronger)) {
    query['IsStronger'] = request.isStronger;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.payStatus)) {
    query['PayStatus'] = request.payStatus;
  }
  if (!Util.isUnset(request.ramUid)) {
    query['RamUid'] = request.ramUid;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBillList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getBillList(request: GetBillListRequest): GetBillListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBillListWithOptions(request, runtime);
}

model GetCreditInfoRequest {
  uid?: long(name='Uid'),
}

model GetCreditInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    accountStatus?: string(name='AccountStatus'),
    alarmThreshold?: string(name='AlarmThreshold'),
    availableCredit?: string(name='AvailableCredit'),
    creditLine?: string(name='CreditLine'),
    outstandingBalance?: string(name='OutstandingBalance'),
    zeroCreditShutdownPolicy?: string(name='ZeroCreditShutdownPolicy'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetCreditInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCreditInfoResponseBody(name='body'),
}

async function getCreditInfoWithOptions(request: GetCreditInfoRequest, runtime: Util.RuntimeOptions): GetCreditInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCreditInfo',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCreditInfo(request: GetCreditInfoRequest): GetCreditInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreditInfoWithOptions(request, runtime);
}

model GetCustomerListRequest {
  aliyunPk?: long(name='AliyunPk'),
  currentPage?: int32(name='CurrentPage'),
  customerAccount?: string(name='CustomerAccount'),
  customerGcLevel?: string(name='CustomerGcLevel'),
  customerName?: string(name='CustomerName'),
  customerStatus?: int32(name='CustomerStatus'),
  end?: string(name='End'),
  pageSize?: int32(name='PageSize'),
  ramUid?: long(name='RamUid'),
  start?: string(name='Start'),
}

model GetCustomerListResponseBody = {
  code?: string(name='Code'),
  data?: {
    list?: {
      fxCustomerReportDTO?: [ 
      {
        cid?: long(name='Cid'),
        customerGcLevel?: string(name='CustomerGcLevel'),
        customerName?: string(name='CustomerName'),
        customerStatus?: int32(name='CustomerStatus'),
        customerType?: int32(name='CustomerType'),
        customerUids?: {
          customerUid?: [ string ](name='CustomerUid')
        }(name='CustomerUids'),
        expireTime?: string(name='ExpireTime'),
        gcLevelAmountInfo?: {
          oneMonthAmount?: string(name='OneMonthAmount'),
          showOne?: boolean(name='ShowOne'),
          showSix?: boolean(name='ShowSix'),
          showThree?: boolean(name='ShowThree'),
          sixMonthAmount?: string(name='SixMonthAmount'),
          threeMonthAmount?: string(name='ThreeMonthAmount'),
          twelveMonthAmount?: string(name='TwelveMonthAmount'),
        }(name='GcLevelAmountInfo'),
        hasAccount?: int32(name='HasAccount'),
        reportedTime?: string(name='ReportedTime'),
      }
    ](name='FxCustomerReportDTO')
    }(name='List'),
  }(name='Data'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetCustomerListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCustomerListResponseBody(name='body'),
}

async function getCustomerListWithOptions(request: GetCustomerListRequest, runtime: Util.RuntimeOptions): GetCustomerListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.customerAccount)) {
    query['CustomerAccount'] = request.customerAccount;
  }
  if (!Util.isUnset(request.customerGcLevel)) {
    query['CustomerGcLevel'] = request.customerGcLevel;
  }
  if (!Util.isUnset(request.customerName)) {
    query['CustomerName'] = request.customerName;
  }
  if (!Util.isUnset(request.customerStatus)) {
    query['CustomerStatus'] = request.customerStatus;
  }
  if (!Util.isUnset(request.end)) {
    query['End'] = request.end;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ramUid)) {
    query['RamUid'] = request.ramUid;
  }
  if (!Util.isUnset(request.start)) {
    query['Start'] = request.start;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomerList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCustomerList(request: GetCustomerListRequest): GetCustomerListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomerListWithOptions(request, runtime);
}

model GetDailyBillRequest {
  billOwner?: string(name='BillOwner'),
  billType?: string(name='BillType'),
  date?: string(name='Date'),
}

model GetDailyBillResponseBody = {
  code?: string(name='Code'),
  data?: {
    billLinkCSV?: string(name='BillLinkCSV'),
    billLinkXLSX?: string(name='BillLinkXLSX'),
    billOwner?: string(name='BillOwner'),
    billType?: string(name='BillType'),
    spendingTime?: string(name='SpendingTime'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetDailyBillResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDailyBillResponseBody(name='body'),
}

async function getDailyBillWithOptions(request: GetDailyBillRequest, runtime: Util.RuntimeOptions): GetDailyBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.billOwner)) {
    query['BillOwner'] = request.billOwner;
  }
  if (!Util.isUnset(request.billType)) {
    query['BillType'] = request.billType;
  }
  if (!Util.isUnset(request.date)) {
    query['Date'] = request.date;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDailyBill',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDailyBill(request: GetDailyBillRequest): GetDailyBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDailyBillWithOptions(request, runtime);
}

model GetDailyBillListRequest {
  aliyunPk?: long(name='AliyunPk'),
  billTime?: string(name='BillTime'),
  billType?: string(name='BillType'),
  userType?: string(name='UserType'),
}

model GetDailyBillListResponseBody = {
  bigBillJson?: {
    billLinkCSV?: string(name='BillLinkCSV'),
    billLinkXLSX?: string(name='BillLinkXLSX'),
    billTime?: string(name='BillTime'),
    billType?: string(name='BillType'),
    productType?: string(name='ProductType'),
    userType?: string(name='UserType'),
  }(name='BigBillJson'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetDailyBillListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDailyBillListResponseBody(name='body'),
}

async function getDailyBillListWithOptions(request: GetDailyBillListRequest, runtime: Util.RuntimeOptions): GetDailyBillListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.billTime)) {
    query['BillTime'] = request.billTime;
  }
  if (!Util.isUnset(request.billType)) {
    query['BillType'] = request.billType;
  }
  if (!Util.isUnset(request.userType)) {
    query['UserType'] = request.userType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDailyBillList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDailyBillList(request: GetDailyBillListRequest): GetDailyBillListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDailyBillListWithOptions(request, runtime);
}

model GetInstanceListRequest {
  ak?: string(name='Ak'),
  aliyunPk?: long(name='AliyunPk'),
  currentPage?: int32(name='CurrentPage'),
  instanceId?: string(name='InstanceId'),
  pageSize?: int32(name='PageSize'),
  publicIpAddresse?: string(name='PublicIpAddresse'),
  regionId?: string(name='RegionId'),
  sk?: string(name='Sk'),
  tag?: int32(name='Tag'),
}

model GetInstanceListResponseBody = {
  code?: string(name='Code'),
  dataList?: {
    data?: [ 
    {
      aliyunPk?: string(name='AliyunPk'),
      instanceId?: string(name='InstanceId'),
      localName?: string(name='LocalName'),
      publicIpAddress?: string(name='PublicIpAddress'),
      regionId?: string(name='RegionId'),
      status?: string(name='Status'),
    }
  ](name='data')
  }(name='DataList'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetInstanceListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInstanceListResponseBody(name='body'),
}

async function getInstanceListWithOptions(request: GetInstanceListRequest, runtime: Util.RuntimeOptions): GetInstanceListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ak)) {
    query['Ak'] = request.ak;
  }
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.publicIpAddresse)) {
    query['PublicIpAddresse'] = request.publicIpAddresse;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sk)) {
    query['Sk'] = request.sk;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInstanceList(request: GetInstanceListRequest): GetInstanceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceListWithOptions(request, runtime);
}

model GetInviteStatusRequest {
  inviteStatusList?: [ 
    {
      inviteId?: long(name='InviteId'),
    }
  ](name='InviteStatusList'),
}

model GetInviteStatusResponseBody = {
  code?: string(name='Code'),
  data?: {
    inviteStatus?: [ 
    {
      code?: string(name='Code'),
      inviteStatusList?: {
        associationSuccessTime?: string(name='AssociationSuccessTime'),
        cid?: long(name='Cid'),
        gmtCreate?: string(name='GmtCreate'),
        parentId?: string(name='ParentId'),
        status?: int32(name='Status'),
        subAccountType?: string(name='SubAccountType'),
        uid?: long(name='Uid'),
      }(name='InviteStatusList'),
      message?: string(name='Message'),
      success?: boolean(name='Success'),
    }
  ](name='InviteStatus')
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetInviteStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetInviteStatusResponseBody(name='body'),
}

async function getInviteStatusWithOptions(request: GetInviteStatusRequest, runtime: Util.RuntimeOptions): GetInviteStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.inviteStatusList)) {
    query['InviteStatusList'] = request.inviteStatusList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInviteStatus',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getInviteStatus(request: GetInviteStatusRequest): GetInviteStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInviteStatusWithOptions(request, runtime);
}

model GetMonthBillListRequest {
  monthBillTime?: string(name='MonthBillTime'),
  monthBillType?: string(name='MonthBillType'),
  monthUserType?: string(name='MonthUserType'),
  uid?: long(name='Uid'),
}

model GetMonthBillListResponseBody = {
  bigBillJson?: {
    billLinkCSV?: string(name='BillLinkCSV'),
    billLinkXLSX?: string(name='BillLinkXLSX'),
    billTime?: string(name='BillTime'),
    billType?: string(name='BillType'),
    invoiceLink?: string(name='InvoiceLink'),
    productType?: string(name='ProductType'),
    refundInvoiceFlag?: boolean(name='RefundInvoiceFlag'),
    refundInvoiceLink?: string(name='RefundInvoiceLink'),
    userType?: string(name='UserType'),
  }(name='BigBillJson'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetMonthBillListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMonthBillListResponseBody(name='body'),
}

async function getMonthBillListWithOptions(request: GetMonthBillListRequest, runtime: Util.RuntimeOptions): GetMonthBillListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.monthBillTime)) {
    query['MonthBillTime'] = request.monthBillTime;
  }
  if (!Util.isUnset(request.monthBillType)) {
    query['MonthBillType'] = request.monthBillType;
  }
  if (!Util.isUnset(request.monthUserType)) {
    query['MonthUserType'] = request.monthUserType;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMonthBillList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMonthBillList(request: GetMonthBillListRequest): GetMonthBillListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMonthBillListWithOptions(request, runtime);
}

model GetMonthlyBillRequest {
  billOwner?: string(name='BillOwner'),
  billType?: string(name='BillType'),
  month?: string(name='Month'),
}

model GetMonthlyBillResponseBody = {
  code?: string(name='Code'),
  data?: {
    billLinkCSV?: string(name='BillLinkCSV'),
    billLinkXLSX?: string(name='BillLinkXLSX'),
    billOwner?: string(name='BillOwner'),
    billType?: string(name='BillType'),
    invoiceLink?: string(name='InvoiceLink'),
    refundInvoiceFlag?: boolean(name='RefundInvoiceFlag'),
    refundInvoiceLink?: string(name='RefundInvoiceLink'),
    spendingTime?: string(name='SpendingTime'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetMonthlyBillResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMonthlyBillResponseBody(name='body'),
}

async function getMonthlyBillWithOptions(request: GetMonthlyBillRequest, runtime: Util.RuntimeOptions): GetMonthlyBillResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.billOwner)) {
    query['BillOwner'] = request.billOwner;
  }
  if (!Util.isUnset(request.billType)) {
    query['BillType'] = request.billType;
  }
  if (!Util.isUnset(request.month)) {
    query['Month'] = request.month;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetMonthlyBill',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMonthlyBill(request: GetMonthlyBillRequest): GetMonthlyBillResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMonthlyBillWithOptions(request, runtime);
}

model GetOrderDetailRequest {
  aliyunPk?: long(name='AliyunPk'),
  orderNo?: long(name='OrderNo'),
}

model GetOrderDetailResponseBody = {
  code?: string(name='Code'),
  data?: {
    chargeType?: long(name='ChargeType'),
    cycle?: string(name='Cycle'),
    gmtCreate?: string(name='GmtCreate'),
    orderId?: long(name='OrderId'),
    orderStatus?: long(name='OrderStatus'),
    orderTypeName?: string(name='OrderTypeName'),
    payAmount?: string(name='PayAmount'),
    payTime?: string(name='PayTime'),
    resourceFee?: string(name='ResourceFee'),
    totalPayFee?: string(name='TotalPayFee'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetOrderDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOrderDetailResponseBody(name='body'),
}

async function getOrderDetailWithOptions(request: GetOrderDetailRequest, runtime: Util.RuntimeOptions): GetOrderDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.orderNo)) {
    query['OrderNo'] = request.orderNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOrderDetail',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOrderDetail(request: GetOrderDetailRequest): GetOrderDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOrderDetailWithOptions(request, runtime);
}

model GetOrderListRequest {
  aliyunPk?: long(name='AliyunPk'),
  currentPage?: int32(name='CurrentPage'),
  endDate?: string(name='EndDate'),
  isStronger?: int32(name='IsStronger'),
  orderId?: long(name='OrderId'),
  pageSize?: int32(name='PageSize'),
  ramUid?: long(name='RamUid'),
  startDate?: string(name='StartDate'),
  status?: long(name='Status'),
  timeType?: int32(name='TimeType'),
}

model GetOrderListResponseBody = {
  code?: string(name='Code'),
  data?: {
    popOrderJson?: [ 
    {
      anotherPay?: int32(name='AnotherPay'),
      articleName?: string(name='ArticleName'),
      fee?: string(name='Fee'),
      gmtCreate?: string(name='GmtCreate'),
      orderId?: long(name='OrderId'),
      orderStatus?: long(name='OrderStatus'),
      orderTypeName?: string(name='OrderTypeName'),
      payTime?: string(name='PayTime'),
      payment?: string(name='Payment'),
      ramUid?: long(name='RamUid'),
    }
  ](name='PopOrderJson')
  }(name='Data'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetOrderListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetOrderListResponseBody(name='body'),
}

async function getOrderListWithOptions(request: GetOrderListRequest, runtime: Util.RuntimeOptions): GetOrderListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.isStronger)) {
    query['IsStronger'] = request.isStronger;
  }
  if (!Util.isUnset(request.orderId)) {
    query['OrderId'] = request.orderId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ramUid)) {
    query['RamUid'] = request.ramUid;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.timeType)) {
    query['TimeType'] = request.timeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOrderList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOrderList(request: GetOrderListRequest): GetOrderListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOrderListWithOptions(request, runtime);
}

model GetShareAccountListRequest {
  aliyunPk?: long(name='AliyunPk'),
  currentPage?: int32(name='CurrentPage'),
  customerAccount?: string(name='CustomerAccount'),
  customerName?: string(name='CustomerName'),
  pageSize?: int32(name='PageSize'),
  ramUid?: long(name='RamUid'),
}

model GetShareAccountListResponseBody = {
  code?: string(name='Code'),
  dataList?: {
    data?: [ 
    {
      cid?: long(name='Cid'),
      cloudAccount?: string(name='CloudAccount'),
      customerAccount?: string(name='CustomerAccount'),
      customerName?: string(name='CustomerName'),
      customerPhone?: string(name='CustomerPhone'),
      parentUid?: long(name='ParentUid'),
      uid?: long(name='Uid'),
    }
  ](name='data')
  }(name='DataList'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetShareAccountListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetShareAccountListResponseBody(name='body'),
}

async function getShareAccountListWithOptions(request: GetShareAccountListRequest, runtime: Util.RuntimeOptions): GetShareAccountListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.customerAccount)) {
    query['CustomerAccount'] = request.customerAccount;
  }
  if (!Util.isUnset(request.customerName)) {
    query['CustomerName'] = request.customerName;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ramUid)) {
    query['RamUid'] = request.ramUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetShareAccountList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getShareAccountList(request: GetShareAccountListRequest): GetShareAccountListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getShareAccountListWithOptions(request, runtime);
}

model GetShareCustomerListRequest {
  aliyunPk?: long(name='AliyunPk'),
  currentPage?: int32(name='CurrentPage'),
  customerAccount?: string(name='CustomerAccount'),
  customerName?: string(name='CustomerName'),
  customerType?: string(name='CustomerType'),
  exitOnGoingProject?: string(name='ExitOnGoingProject'),
  pageSize?: int32(name='PageSize'),
  ramUid?: long(name='RamUid'),
}

model GetShareCustomerListResponseBody = {
  code?: string(name='Code'),
  dataList?: {
    data?: [ 
    {
      cid?: long(name='Cid'),
      customerAccounts?: {
        customerAccount?: [ string ](name='CustomerAccount')
      }(name='CustomerAccounts'),
      customerName?: string(name='CustomerName'),
      customerType?: int32(name='CustomerType'),
      customerUids?: {
        customerUid?: [ string ](name='CustomerUid')
      }(name='CustomerUids'),
      exitOnGoingProject?: string(name='ExitOnGoingProject'),
      parentUid?: long(name='ParentUid'),
    }
  ](name='data')
  }(name='DataList'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetShareCustomerListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetShareCustomerListResponseBody(name='body'),
}

async function getShareCustomerListWithOptions(request: GetShareCustomerListRequest, runtime: Util.RuntimeOptions): GetShareCustomerListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.customerAccount)) {
    query['CustomerAccount'] = request.customerAccount;
  }
  if (!Util.isUnset(request.customerName)) {
    query['CustomerName'] = request.customerName;
  }
  if (!Util.isUnset(request.customerType)) {
    query['CustomerType'] = request.customerType;
  }
  if (!Util.isUnset(request.exitOnGoingProject)) {
    query['ExitOnGoingProject'] = request.exitOnGoingProject;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ramUid)) {
    query['RamUid'] = request.ramUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetShareCustomerList',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getShareCustomerList(request: GetShareCustomerListRequest): GetShareCustomerListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getShareCustomerListWithOptions(request, runtime);
}

model GetSubAccountInfoRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  uid?: long(name='Uid'),
  userType?: string(name='UserType'),
}

model GetSubAccountInfoResponseBody = {
  accountInfoList?: {
    accountInfo?: [ 
    {
      accountNickname?: string(name='AccountNickname'),
      associationSuccessTime?: string(name='AssociationSuccessTime'),
      email?: string(name='Email'),
      mobile?: string(name='Mobile'),
      remark?: string(name='Remark'),
      subAccountType?: int32(name='SubAccountType'),
      uid?: long(name='Uid'),
    }
  ](name='AccountInfo')
  }(name='AccountInfoList'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetSubAccountInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetSubAccountInfoResponseBody(name='body'),
}

async function getSubAccountInfoWithOptions(request: GetSubAccountInfoRequest, runtime: Util.RuntimeOptions): GetSubAccountInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.userType)) {
    query['UserType'] = request.userType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSubAccountInfo',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getSubAccountInfo(request: GetSubAccountInfoRequest): GetSubAccountInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSubAccountInfoWithOptions(request, runtime);
}

model GetUnassociatedCustomerRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
}

model GetUnassociatedCustomerResponseBody = {
  code?: string(name='Code'),
  inviteInfoList?: {
    inviteInfo?: [ 
    {
      accountNickname?: string(name='AccountNickname'),
      email?: string(name='Email'),
      gmtCreate?: string(name='GmtCreate'),
      inviteId?: long(name='InviteId'),
      status?: int32(name='Status'),
    }
  ](name='InviteInfo')
  }(name='InviteInfoList'),
  message?: string(name='Message'),
  pageInfo?: {
    page?: int32(name='Page'),
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
  }(name='PageInfo'),
  success?: boolean(name='Success'),
}

model GetUnassociatedCustomerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUnassociatedCustomerResponseBody(name='body'),
}

async function getUnassociatedCustomerWithOptions(request: GetUnassociatedCustomerRequest, runtime: Util.RuntimeOptions): GetUnassociatedCustomerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUnassociatedCustomer',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUnassociatedCustomer(request: GetUnassociatedCustomerRequest): GetUnassociatedCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUnassociatedCustomerWithOptions(request, runtime);
}

model InviteSubAccountRequest {
  accountInfoList?: [ 
    {
      accountNickname?: string(name='AccountNickname'),
      creditLine?: string(name='CreditLine'),
      emailAddress?: string(name='EmailAddress'),
      remark?: string(name='Remark'),
      subAccountType?: string(name='SubAccountType'),
      zeroCreditShutdownPolicy?: string(name='ZeroCreditShutdownPolicy'),
    }
  ](name='AccountInfoList'),
}

model InviteSubAccountResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  results?: {
    result?: [ 
    {
      code?: string(name='Code'),
      message?: string(name='Message'),
      result?: {
        days?: int32(name='Days'),
        inviteId?: long(name='InviteId'),
        regUrl?: string(name='RegUrl'),
      }(name='Result'),
      success?: boolean(name='Success'),
    }
  ](name='Result')
  }(name='Results'),
  success?: boolean(name='Success'),
}

model InviteSubAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: InviteSubAccountResponseBody(name='body'),
}

async function inviteSubAccountWithOptions(request: InviteSubAccountRequest, runtime: Util.RuntimeOptions): InviteSubAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountInfoList)) {
    query['AccountInfoList'] = request.accountInfoList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InviteSubAccount',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function inviteSubAccount(request: InviteSubAccountRequest): InviteSubAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return inviteSubAccountWithOptions(request, runtime);
}

model ReportCustomerRequest {
  reportCustomerInfoList?: [ 
    {
      aliyunPk?: long(name='AliyunPk'),
      customerName?: string(name='CustomerName'),
      customerSubTrade?: string(name='CustomerSubTrade'),
      customerTrade?: string(name='CustomerTrade'),
      customerType?: int32(name='CustomerType'),
      phoneNumber?: string(name='PhoneNumber'),
      ramUid?: long(name='RamUid'),
    }
  ](name='ReportCustomerInfoList'),
}

model ReportCustomerResponseBody = {
  code?: string(name='Code'),
  data?: {
    result?: [ 
    {
      code?: string(name='Code'),
      data?: boolean(name='Data'),
      message?: string(name='Message'),
      success?: boolean(name='Success'),
    }
  ](name='Result')
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ReportCustomerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReportCustomerResponseBody(name='body'),
}

async function reportCustomerWithOptions(request: ReportCustomerRequest, runtime: Util.RuntimeOptions): ReportCustomerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.reportCustomerInfoList)) {
    query['ReportCustomerInfoList'] = request.reportCustomerInfoList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportCustomer',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function reportCustomer(request: ReportCustomerRequest): ReportCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportCustomerWithOptions(request, runtime);
}

model ResendEmailRequest {
  inviteId?: long(name='InviteId'),
}

model ResendEmailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ResendEmailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResendEmailResponseBody(name='body'),
}

async function resendEmailWithOptions(request: ResendEmailRequest, runtime: Util.RuntimeOptions): ResendEmailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.inviteId)) {
    query['InviteId'] = request.inviteId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResendEmail',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resendEmail(request: ResendEmailRequest): ResendEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return resendEmailWithOptions(request, runtime);
}

model SetAccountInfoRequest {
  accountNickname?: string(name='AccountNickname'),
  remark?: string(name='Remark'),
  uid?: long(name='Uid'),
}

model SetAccountInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetAccountInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAccountInfoResponseBody(name='body'),
}

async function setAccountInfoWithOptions(request: SetAccountInfoRequest, runtime: Util.RuntimeOptions): SetAccountInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountNickname)) {
    query['AccountNickname'] = request.accountNickname;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAccountInfo',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAccountInfo(request: SetAccountInfoRequest): SetAccountInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAccountInfoWithOptions(request, runtime);
}

model SetCreditLimitRequest {
  aliyunPk?: long(name='AliyunPk'),
  endUserPk?: long(name='EndUserPk'),
  quota?: string(name='Quota'),
}

model SetCreditLimitResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetCreditLimitResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetCreditLimitResponseBody(name='body'),
}

async function setCreditLimitWithOptions(request: SetCreditLimitRequest, runtime: Util.RuntimeOptions): SetCreditLimitResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunPk)) {
    query['AliyunPk'] = request.aliyunPk;
  }
  if (!Util.isUnset(request.endUserPk)) {
    query['EndUserPk'] = request.endUserPk;
  }
  if (!Util.isUnset(request.quota)) {
    query['Quota'] = request.quota;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetCreditLimit',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setCreditLimit(request: SetCreditLimitRequest): SetCreditLimitResponse {
  var runtime = new Util.RuntimeOptions{};
  return setCreditLimitWithOptions(request, runtime);
}

model SetCreditLimitStatusRequest {
  creditStatus?: long(name='CreditStatus'),
  uid?: long(name='Uid'),
}

model SetCreditLimitStatusResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetCreditLimitStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetCreditLimitStatusResponseBody(name='body'),
}

async function setCreditLimitStatusWithOptions(request: SetCreditLimitStatusRequest, runtime: Util.RuntimeOptions): SetCreditLimitStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creditStatus)) {
    query['CreditStatus'] = request.creditStatus;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetCreditLimitStatus',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setCreditLimitStatus(request: SetCreditLimitStatusRequest): SetCreditLimitStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setCreditLimitStatusWithOptions(request, runtime);
}

model SetCreditLineRequest {
  creditLine?: string(name='CreditLine'),
  uid?: long(name='Uid'),
}

model SetCreditLineResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetCreditLineResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetCreditLineResponseBody(name='body'),
}

async function setCreditLineWithOptions(request: SetCreditLineRequest, runtime: Util.RuntimeOptions): SetCreditLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creditLine)) {
    query['CreditLine'] = request.creditLine;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetCreditLine',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setCreditLine(request: SetCreditLineRequest): SetCreditLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return setCreditLineWithOptions(request, runtime);
}

model SetCreditStatusRequest {
  creditStatus?: long(name='CreditStatus'),
  uid?: long(name='Uid'),
}

model SetCreditStatusResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetCreditStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetCreditStatusResponseBody(name='body'),
}

async function setCreditStatusWithOptions(request: SetCreditStatusRequest, runtime: Util.RuntimeOptions): SetCreditStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creditStatus)) {
    query['CreditStatus'] = request.creditStatus;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetCreditStatus',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setCreditStatus(request: SetCreditStatusRequest): SetCreditStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setCreditStatusWithOptions(request, runtime);
}

model SetWarningThresholdRequest {
  uid?: long(name='Uid'),
  warningValue?: string(name='WarningValue'),
}

model SetWarningThresholdResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetWarningThresholdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetWarningThresholdResponseBody(name='body'),
}

async function setWarningThresholdWithOptions(request: SetWarningThresholdRequest, runtime: Util.RuntimeOptions): SetWarningThresholdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.warningValue)) {
    query['WarningValue'] = request.warningValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetWarningThreshold',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setWarningThreshold(request: SetWarningThresholdRequest): SetWarningThresholdResponse {
  var runtime = new Util.RuntimeOptions{};
  return setWarningThresholdWithOptions(request, runtime);
}

model SetZeroCreditShutdownPolicyRequest {
  shutdownPolicy?: string(name='ShutdownPolicy'),
  uid?: long(name='Uid'),
}

model SetZeroCreditShutdownPolicyResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetZeroCreditShutdownPolicyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetZeroCreditShutdownPolicyResponseBody(name='body'),
}

async function setZeroCreditShutdownPolicyWithOptions(request: SetZeroCreditShutdownPolicyRequest, runtime: Util.RuntimeOptions): SetZeroCreditShutdownPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.shutdownPolicy)) {
    query['ShutdownPolicy'] = request.shutdownPolicy;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetZeroCreditShutdownPolicy',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setZeroCreditShutdownPolicy(request: SetZeroCreditShutdownPolicyRequest): SetZeroCreditShutdownPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return setZeroCreditShutdownPolicyWithOptions(request, runtime);
}

model SetZeroCreditShutdownStatusRequest {
  shutdownPolicy?: string(name='ShutdownPolicy'),
  uid?: long(name='Uid'),
}

model SetZeroCreditShutdownStatusResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model SetZeroCreditShutdownStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetZeroCreditShutdownStatusResponseBody(name='body'),
}

async function setZeroCreditShutdownStatusWithOptions(request: SetZeroCreditShutdownStatusRequest, runtime: Util.RuntimeOptions): SetZeroCreditShutdownStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.shutdownPolicy)) {
    query['ShutdownPolicy'] = request.shutdownPolicy;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetZeroCreditShutdownStatus',
    version = '2018-07-03',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setZeroCreditShutdownStatus(request: SetZeroCreditShutdownStatusRequest): SetZeroCreditShutdownStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setZeroCreditShutdownStatusWithOptions(request, runtime);
}

